// ****************************************************************************
//
// Logic 8: Cliff Edge
//
// ****************************************************************************

#include "defines.txt"

if (new_room) {
  load.pic(room_no);
  draw.pic(room_no);
  discard.pic(room_no);
  set.horizon(37);


// Check what room the player came from and position them on the
// screen accordingly here, e.g:
// if (prev_room_no == 5) {
//   position(ego,12,140);
// }

  draw(ego);
  show.pic();
}

if (said("look")) {
  print("You are on the edge of a cliff.  You can look down across a lush mahogany forest.");
}

if (ego_edge_code == horizon_edge) {  // ego touching horizon
  new.room(8);
}

if (ego_edge_code == right_edge) {    // ego touching right edge of screen
  new.room(3);
}

if (ego_touching_signal_line) { //Fall off cliff
   erase(ego);
   print("Congratulations!!  You've just proved the existence of gravity.");
   shake.screen(1);
   print("I hope you enjoyed the view on the way down.");
   death_type = 1;
   }

return();